package com.shycloud.mido.music.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shycloud.mido.music.domain.MisMusicMemberStar;
import com.shycloud.mido.music.vo.MusicMemberStarRankVO;
import com.shycloud.mido.music.vo.MusicMemberStarVO;
import java.time.LocalDate;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface MisMusicMemberStarMapper extends BaseMapper<MisMusicMemberStar> {

	@SqlParser(filter = true)
	IPage<MusicMemberStarVO> getMemberRankByMusicId(
			@Param("page") Page page,
			@Param("musicId") Integer musicId,
			@Param("memberId") String memberId);

	@SqlParser(filter = true)
	MusicMemberStarRankVO getMemberRankByMusicIdMe(
			@Param("musicId") Integer musicId,
			@Param("memberId") String memberId);

	@SqlParser(filter = true)
	IPage<MusicMemberStarRankVO> getMemberRankHardWorking(
			@Param("page") Page page,
			@Param("startDate") LocalDate startDate,
			@Param("endDate") LocalDate endDate,
			@Param("memberId") String memberId);

	@SqlParser(filter = true)
	IPage<MusicMemberStarRankVO> getMemberRankFullMark(
			@Param("page") Page page,
			@Param("startDate") LocalDate startDate,
			@Param("endDate") LocalDate endDate,
			@Param("memberId") String memberId);

	@SqlParser(filter = true)
	MusicMemberStarRankVO getMemberRankFullMarkMe(
			@Param("startDate") LocalDate startDate,
			@Param("endDate") LocalDate endDate,
			@Param("memberId") String memberId);

	@SqlParser(filter = true)
	MusicMemberStarRankVO getMemberRankHardWorkingMe(
			@Param("startDate") LocalDate startDate,
			@Param("endDate") LocalDate endDate,
			@Param("memberId") String memberId);

	@SqlParser(filter = true)
	List<MusicMemberStarRankVO> getMemberRankHardWorkingByRank(
			@Param("memberId") String memberId,
			@Param("startDate") LocalDate startDate,
			@Param("endDate") LocalDate endDate,
			@Param("beforeRank") Integer beforeRank,
			@Param("afterRank") Integer afterRank
	);

	@SqlParser(filter = true)
	List<MusicMemberStarRankVO> getMemberRankFullMarkByRank(
			@Param("memberId") String memberId,
			@Param("startDate") LocalDate startDate,
			@Param("endDate") LocalDate endDate,
			@Param("beforeRank") Integer beforeRank,
			@Param("afterRank") Integer afterRank);

	MusicMemberStarRankVO getMemberInfo(@Param("memberId") String memberId);

	List<MisMusicMemberStar> getStarCountByMemberId(@Param("memberId") String memberId);

	Integer getBestScoreByMemberId(@Param("memberId") String memberId, @Param("musicId") String musicId);

	List<MisMusicMemberStar> getHardWorkingStarList(@Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);

	@SqlParser(filter = true)
	int delOtherHardWorkingData(@Param("musicId") Integer musicId, @Param("memberId") String memberId,
			@Param("hardworkingStar") Integer hardworkingStar, @Param("startDate") LocalDate startDate,
			@Param("endDate") LocalDate endDate);

	@SqlParser(filter = true)
	List<MusicMemberStarRankVO> getMemberRankByMusicIdByRank(
			@Param("memberId") String memberId,
			@Param("musicId") Integer musicId,
			@Param("rankBefore") Integer rankBefore,
			@Param("rankAfter") Integer rankAfter);

}